/**
 * 
 */
package co.fitstart.admin.dao;

import java.util.List;

import com.demo2do.core.persistence.annotation.Dynamic;
import com.demo2do.core.persistence.annotation.Limit;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;

import co.fitstart.entity.credit.order.CreditOrder;
import co.fitstart.entity.credit.order.CreditOrderStatus;
import co.fitstart.entity.credit.product.CreditProductType;

/**
 * @author houtao
 *
 */
@Dynamic("hibernate")
public interface CreditOrderDao {
    
    /**
     * 
     * @param type
     * @param status
     * @param beginIndex
     * @param maxResult
     * @return
     */
    @Limit
    @Query("FROM CreditOrder order WHERE order.disabled = false AND order.type = :type AND order.status =:status ORDER BY order.createTime DESC")
    public List<CreditOrder> listByPage(@Variable("type")CreditProductType type, @Variable("status")CreditOrderStatus status, @Variable("beginIndex") int beginIndex, @Variable("maxResult") int maxResult);
    
}
